package com.chen.manager.controller;

import com.chen.manager.mapper.SysMenuMapper;
import com.chen.manager.service.SysMenuRoleService;
import com.chen.model.dto.system.AssignMenuDto;
import com.chen.model.vo.common.Result;
import com.chen.model.vo.common.ResultCodeEnum;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.Map;

/**
 * @author cgj
 * @date 2/25/25 7:33 PM
 */
@RestController
//Request URL:
//http://localhost:8501/admin/system/sysMenuRoleController/showAll/52
@RequestMapping("/admin/system/sysMenuRoleController")
public class SysMenuRoleController {
    @Autowired
    private SysMenuRoleService sysMenuRoleService;
    @PostMapping("/save")
    public  Result sava(@RequestBody AssignMenuDto assignMenuDto){
        sysMenuRoleService.sava(assignMenuDto);
        return Result.build(null,ResultCodeEnum.SUCCESS);
    }
    @GetMapping("/showAll/{id}")
    public Result<Map<String,Object>> showAll(@PathVariable Long id){
        //查询所有
     Map<String,Object> ResultMap =  sysMenuRoleService.showAll(id);


        return  Result.build(ResultMap, ResultCodeEnum.SUCCESS);
    }
}
